Page({
  data: {
    visitorList: []
  },
  goPassport(ev) {
    wx.navigateTo({
      url: '/visitor_pkg/pages/passport/index?id=' + ev.mark.id,
    })
  },
  onLoad() {
    this.getVistorList()
  },
  async getVistorList() {
    const {
      code,
      data
    } = await wx.http.get('/visitor', {
      current: 1,
      pageSize: 10
    })
    if (code !== 10000) return wx.utils.toast('获取访客记录失败')
    this.setData({
      visitorList: data.rows
    })
  }
})